package com.netty.imp;

import lombok.AllArgsConstructor;

/**
 * Instance Messaging Protocol 即时通信协议
 * 枚举类定义消息指令
 *
 * @author kewei
 */
@AllArgsConstructor
public enum IMP {

    SYSTEM, LOGIN, LOGOUT, CHAT, FLOWER, PING, PONG,CLOSE;

    public static boolean isIMP(String content) {
        return content.matches("^\\[(SYSTEM|LOGIN|LOGOUT|CHAT|PING|PONG|CLOSE)\\]");
    }
}
